<?php
class Zend_View_Helper_showTableProductDetail {

    public function showTableProductDetail($view) {
        
        $Product = $view->Product;
        $arrProduct = $view->arrProductdetail; 
        $arrProductOption = $arrProduct['option'];
        $arrProductValue  = $arrProduct['value'];
        
        //Show main info
        $strHtml = '';
        $strHtml .= '<table class="hovertable">';
        $strHtml .= '<tr>';
        $strHtml .= '<th>Tên sản phẩm</th>';
        $strHtml .= '<th>Dòng sản phẩm</th>';
        $strHtml .= '<th>Số lượng</th>';
        $strHtml .= '<th>Giá tiền</th>';
        $strHtml .= '<th>Trọng lượng</th>';
        $strHtml .= '<th>Hiển thị</th>';
        $strHtml .= '<th>Thao tác</th>';
        $strHtml .= '</tr>';   
        $strHtml .= '<tr id="tablerow">';
        $strHtml .= '<td> <a href="'.$view->baseUrl().'/product/detail/id/'.$Product->product_id.'">'. $Product->product_name. '</a></td>';
        $strHtml .= '<td>'. $Product->product_model.'</td>';
        $strHtml .= '<td>'. $Product->product_quantity.'</td>';
        $strHtml .= '<td>'. $Product->product_price.'</td>';
        $strHtml .= '<td>'. $Product->product_weight.'</td>';
        $strHtml .= '<td>'. $Product->product_status.'</td>';
        $strHtml .= '<td>
                         <a class="icon-3" href="'.$view->baseUrl().'/product/addinfo/id/'.$Product->product_id.'"/>
                         <a class="icon-1" href="'.$view->baseUrl().'/product/edit/id/'.$Product->product_id.'"/>
                         <a class="icon-2" href="'.$view->baseUrl().'/product/delete/id/'.$Product->product_id.'"/>
                         </td>';
        $strHtml .= '</tr>';
        
        
        $strHtml .= '</table><br><br>';
        
        //Show detail info
        $strHtml .= '<table class="hovertable">';
        $strHtml .= '<tr>';
        $strHtml .= '<th>Tên chi tiết</th>';
        $strHtml .= '<th>Giá trị</th>';
        $strHtml .= '</tr>';
        if(isset($arrProductOption))
        foreach ($arrProductOption as $key => $OptionName) {
            
            $strHtml .= '<tr id="tablerow">';
            $strHtml .= '<td>'. $OptionName.'</td>';
            $strHtml .= '<td>'. $arrProductValue[$key].'</td>';
            $strHtml .= '</tr>';
        }
        
        $strHtml .= '</table>';
        return $strHtml ;
    }
}